public class ExceptionDemo
 {
public void exceptionsDemo()
 {
	System.out.println("Before divide by Zero");
	int i=1/0;
	System.out.println("After divide by Zero");
}

	public static void main(String[] args)
	{
	ExceptionDemo obj=new ExceptionDemo();
	obj.exceptionsDemo();
	}
	
	/*public void exceptionsDemo() 
	{
	System.out.println("Before divide by Zero");
	try
	{
	int i=1/0;
	}
	catch(ArithmeticException ex)
	{
	System.out.println("You can not divide a number by zero");
	}
	System.out.println("After divide by Zero");	
} 
/*
public void exceptionMulticatchDemo()
{
int i=1,j=1;
int[] array = new int[5];
try
{
int sixthElement = array[6];
int result = i/j;
}

catch(ArithmeticException ex)
{
System.out.println("Divide by Zero error");
}
catch(ArrayIndexOutOfBoundsException ex)
{
System.out.println("You are trying to access the out of bounds element"); */
//}
//}
//}
